1. Field of the Invention
In general, the present invention provides a system and program product for displaying a logical structure. Specifically, the present invention provides a way to display a logical structure of nodes without repeatedly displaying particular patterns of nodes such as recursive hierarchical descendants.
2. Related Art
The manipulation of data has become an important and valuable tool in business success. By successfully mining data a company can both plan for growth and identify loss areas. To this extent, various software programs have been developed for performing data manipulation and mining. One such program is WebSphere Business Integrator Brokers version 5 (“WBI”) Toolkit, which is commercially available from International Business Machines Corp. of Armonk, N.Y.
Many of these programs include mapping components that allow a user to visualize relationships among data items. Typically, the mapping components will graphically depict data item relationships in a logical structure of nodes such as a hierarchical tree or the like. Some programs allow the logical structure to be displayed to the user fully expanded. Conversely, other programs will display the logical structure with a certain/predetermined level of expansion that can be manually adjusted by the user to hide or reveal additional nodes (e.g., by expanding or contracting branches of the structure). Where manual expansion is provided, many programs allow a user to quickly expand or contract the entire structure by invoking an “expand all” or “contract all” action.
In cases where there is no recursiveness among data items, providing a visual representation can be a fairly easy task to perform since the logical structure will be finite. For example, the following is an example of a logical structure whose data items have no recursiveness:
InsurancePolicy|-- StartDate|-- EndDate+-- PolicyNumberWith data items such as these, the logical structure can be easily built and will be finite. However, when a logical structure contains recursively cross-referenced data items, full expansion of the structure is impossible since the structure will be infinite. The following is an example of a logical structure whose data items are recursive:
ManufacturedItem|-- ManufacturedItem (*)+-- MotorizedVehicle+-- Structure+-- ManufacturedItem (*)With data item relationships such as these, single-level expansion in the corresponding logical structure is one approach that has been attempted. Unfortunately, if the user is interested in a node that is deep in the logical structure, too many manual expansions could be required.
This problem is especially apparent in XML Schemas, which usually have deep hierarchies and often contain recursive structures. In this and similar cases, users would often prefer for the program to automatically expand the structure for display so that they can use the node of interest to them without having to perform too many single level expansions.
Along these lines, consider the IAA industry standard XML Schema as an example. In this example, there are elements that refer to each other via “containment.” For instance, a garage is a structure that can contain structures, manufactured items and motorized vehicles. All of these contain physical objects and are themselves physical objects. A motorized vehicle is a manufactured item, and also contains other manufactured items and physical objects. A manufactured item can “contain” a motorized vehicle, a garage (which is manufactured) and physical objects among other things. All these relationships are logically sound at the schema level. However, at the instance level, this does not apply. In such cases, a way to expand the structure as deep as possible while trimming at some point to avoid recursion is needed.
In one existing methodology, expansion is ceased when one complete loop is displayed. Specifically, the algorithm used in WBI displays all children of any item, until a hierarchical descendent item either does not have children, or repeats one of its own ancestors. Thus, assuming a logical structure of N items with each item having N items as its children, the total number of nodes that will be displayed for a user who can then perform manual manipulations is defined by the following formula:
      f    ⁡          (      N      )        =      1    +                  ∑                  i          =          1                          N          -          1                    ⁢                        N          !                          i          !                    The concept of stopping expansion at the child/descendant level provided by this formula may work well when the number of the data items involved in the recursive chain is small and if there is only one recursive chain (e.g., such as in the above example). For example, under the above formula, if N=2 a total of 5 nodes will be displayed. However, if there is a significant number of data items involved in the recursive chain, and the data items are heavily cross-referenced (branching off into other recursive chains), then even building a logical structure that stops at a first repeating descendent requires a large amount of memory from an application. For example, if N=10 a total of 9,864,101 nodes will be automatically displayed for the user.
In view of the foregoing, there exists a need for an improved way to truncate or automatically render a logical structure having data matching a predefined pattern. For example, a need exists for a system and program product for displaying a logical structure having a high number of recursive data items that are heavily cross-referenced.